import request from '@/utils/request'

export function courseTable(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_BLOG_API}/api/training/course/table`,
    method: 'post',
    data: query
  })
}

export function courseLoad(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_BLOG_API}/api/training/course/load`,
    method: 'get',
    params: query
  })
}

export function courseSave(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_BLOG_API}/api/training/course/save`,
    method: 'post',
    data: query
  })
}

export function courseDelete(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_BLOG_API}/api/training/course/delete`,
    method: 'post',
    data: query
  })
}

export function courseInfo(id) {
  return request({
    url: `${process.env.VUE_APP_MODULE_BLOG_API}/public/course/info/${id}`,
    method: 'post'
  })
}

export function courseHourSave(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_BLOG_API}/api/training/course/saveHours`,
    method: 'post',
    contentType: 'json',
    data: query
  })
}
